<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width,user-scalable=no, initial-scale=1">
<title>登录</title>
<link rel="stylesheet" type="text/css"
	href="../static/azxcrm/css/wap/aui.css"
	th:href="@{/azxcrm/css/wap/aui.css}" />
<link rel="stylesheet" type="text/css"
	href="//at.alicdn.com/t/font_835360_ni6hp1i077i.css" />
<link rel="stylesheet" type="text/css"
	href="../static/azxcrm/css/wap/aui.css"
	th:href="@{/azxcrm/css/wap/login.css}" />

</head>
<body>
	<header class="aui-bar aui-bar-nav">
		<div class="aui-title">登录</div>
	</header>
	<section class="aui-grid aui-margin-b-15">
		<div class="aui-row">
			<img src="../static/azxcrm/image/wap/logo.png"
				th:src="@{/azxcrm/image/wap/logo.png}" />
		</div>
	</section>
	<div class="aui-content aui-margin-b-15">
		<form id="signupForm">
			<ul class="aui-list aui-form-list">
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label-icon">用户名</div>
						<div class="aui-list-item-input">
							<input type="text" placeholder="请输入用户名" th:name="username">
							<input type="hidden" th:name="loginSource" th:value="wap">
						</div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label-icon">登录密码</div>
						<div class="aui-list-item-input">
							<input id="password" type="password" placeholder="请输入密码"
								name="password">
						</div>
						<div class="aui-list-item-label-icon">
							<i class="iconfont icon-iconset0207" id="Eye" onclick="change()"></i>
						</div>
					</div>
				</li>
			</ul>
			<div class="aui-content-padded">
				<div class="aui-btn aui-btn-info aui-btn-block" id="loginAccess">登录</div>
			</div>
			<a class="quickly" th:href="@{register/registerWap}">立即注册</a>
		</form>
	</div>

	<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
	<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
	<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
</body>
</html>
<script type="text/javascript">

	$("#loginAccess").click(function(){
		login();
    });
	function login() {
		var username =  $("input[name='username']").val();
		var loginSource =  $("input[name='loginSource']").val();
		var password =  $("input[name='password']").val();
	    $.ajax({
	        type: "POST",
	        url: ctx+"/login",
	        data: {
	        	"username":username,
	        	"loginSource":loginSource,
	        	"password":password,
	        }, 
	        success: function(r) {
	            if (r.code == 0) {
	                parent.location.href = ctx + 'indexWap';
	            } else {
	                layer.msg(r.msg);
	            }
	        }
	    });
	}

	var isShow=true;
    function change(){
        var Password = document.getElementById("password");
        var Eye = document.getElementById("Eye");
        if (isShow) {
            Password.type="text";
            isShow=false;
            Eye.style.color="#03a9f4";
        }else{
            Password.type="password";
            isShow=true;
           	Eye.style.color="#212121";
        }
    };
    
    
    
    
</script>